let detailApp = new  Vue({
    el:"#detailApp",
    data:{
        question:{},
        collections:0,
        questId:questionId,
        collectStatus:0

    },
    methods:{
        loadQuestionById(){
            axios.get('/portal/question/detail/'+questionId)
                .then(result=>{
                    let r = result.data
                    this.question = r.data
                    updateQuestionDuration(this.question)
                })
            axios.get('/portal/userCollect/collect/'+questionId)
                .then(result=>{
                    let r = result.data
                    if(r.code==OK){
                        this.collections = r.data
                    }
                })
        },
        loadViews(){

            axios.get('/portal/question/view/'+questionId)
                .then(result=>{
                    let r = result.data
                    console.log(r)
                    if(r.code==OK){

                    }
                })
        },
        makeCollect(){
            axios.get('/portal/userCollect/make/'+questionId)
                .then(result=>{
                    let r = result.data
                    if(r.code == OK){
                        this.collectStatus = 1
                    }
                })
        },
        loadCollectStatus(){
            axios.get('/portal/userCollect/status/'+questionId)
                .then(result=>{
                    let r = result.data
                    console.log(r)
                    if(r.code == OK){
                        this.collectStatus = r.data
                        console.log(this.collectStatus)
                    }
                })
        }
    },
    created(){
        this.loadQuestionById()
        this.loadViews()
        this.loadCollectStatus()
    }


})